<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<script type="text/javascript">
	var userGrid = null;
	var editUserDialog = null;
	$(function(){
		userGrid = $("#user_grid").ligerGrid({
				title : '会员列表',
                columns: [
					{
						display: ' 操作 ', 
						name: 'id',
						width:100,
						isAllowHide: false, 
						isSort : false,
						render: function (record, rowindex, value, column){
							var html = '<a onclick="deleteNickName(\''+ value + '\')" href="javascript:;">作废</a>&nbsp;'; 
							return html; 
						}
					},    
                { display: '用户名', name: 'nickname', isSort : false, width: 120 },
                { display: '真实姓名', name: 'username',isSort : false, width: 200 },
                { display: '会员邮箱', name: 'email',isSort : false, width: 200 }, 
                { display: '创建时间', name: 'gmtCreated',isSort : false,
                  render: function(record, rowindex, value, column){
                	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
                  }}, 
                { display: '最后修改时间', name: 'gmtModified',isSort : false,
                  render: function(record, rowindex, value, column){
                	 return (new Date(value.time)).format("yyyy年MM月dd日 hh:mm:ss");
                  }
                }
                ], 
                pageSize:30,
                root :'list',
                record:'totalRecord',
                url: "/misc/admin/tomemberlist.htm", 
                width: '99%',height:'99%'
            });


	});
	function search(){
		userGrid.options.parms = [{name:'name',value:$("#search_name").val()}];
		userGrid.loadData();
	}
	 function deleteNickName(memberId){
		$.ligerDialog.confirm('你真的要删除吗？', 
			function (yes){
				if(yes){
					$.post("/misc/admin/deleteNickName.htm",{id:memberId},function(){
						userGrid.loadData();
					}); 
				}
			});
	} 
</script>

<table>
	<tr>
		<td>
			<div id="searchbar">
			   类型名称：<input id="search_name" type="text" />
			    	  <input id="btnOK" type="button" value="查询" onclick="search()" />
			</div>
		</td>
	</tr>
</table>
<div id="user_grid" style="margin:0; padding:0"></div>
